Building a VRWeapon
= Building a weapon = Bring a weapon model into the scene. For my example, I'll be using ChamferZone's AKM, found free on the asset store. The only thing required to use a model is a collider of some sort. I will be using a convex mesh collider, but use whatever collider you desire. Open the VRWeapons Weapon Setup window, found in Window/VRWeapons/Set up new Weapon. * Interaction System As of 2.00, only VRTK has been implemented. More will come soon. * 2-handed weapon If checked, this will set the weapon up for 2-handed use. This will requite an additional collider on the weapon, and add VRTK's ControlDirectionGrabAction script. * Add base weapon script to selected object Pressing this button will add components to the object you currently have selected. In-depth info here. * Create new Muzzle object Press this to add a muzzle GameObject to the weapon - the muzzle must then be positioned at the desired muzzle position of the weapon. The muzzle will always fire in the positive Z direction, so rotate as desired. In-depth info here. * Bolt Type Currently, the only implemented type is Straight Back. This will apply to most weapons, but rotating types (for revolvers, etc) will come soon. * Assign bolt to selected object Select your bolt object, and press this button. This will add the Bolt.cs script to the selected object, as well as a GameObject with a collider named "Bolt Grab Point." More info here. * Create new Ejector This will add an Ejector object to the weapon. The ejector's position does not matter, but rounds will be ejected in the ejector's positive Z direction, so rotate as desired. More info here. * Magazine Type There are two types of magazines built-in to VRWeapons: Simple and complex. Simple magazines have a capacity, and a bullet type, and that's it. They will not show chambered rounds, and have a single bullet behavior assigned to them. More info here. Complex magazines visibly show loaded rounds, and are capable of holding more than one bullet type, for individual round behavior. Example: For every 4 bullets, one tracer is fired. They can also be loaded with individual rounds. More info here. * Set up selected object as Magazine This will add the required components for a magazine to the selected object. Interaction System-specific setup * Set up Magazine DropZone For VRTK, this will add a SnapDropZone in a new GameObject to the same position as the magazine, if a magazine has been set up (and is a child of the weapon). This will also set the DropZone's highlight prefab to the magazine, set the magazine as the default snapped object, and set the magazine's parent to null. The DropZone's collider may need adjustment as desired, and its policy list must be set up. More info here. * Set up Bullet DropZone For VRTK, this will add a SnapDropZone in a new GameObject on the magazine. This is used for complex magazines, in order to add individual rounds to the magazine. More info here.